﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.UI;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Media;

namespace SuperQuiz.Utils
{
    public class AlternateBackgroundConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, string culture)
        {
            if ((bool)value)
            {
                if (Application.Current.RequestedTheme == ApplicationTheme.Dark)
                {
                    return new SolidColorBrush(Color.FromArgb(80, 255, 255, 255));
                }
                return new SolidColorBrush(Color.FromArgb(80, 255, 255, 255));
            }
            else
            {
                return null;
            }
        }


        public object ConvertBack(object value, Type targetType, object parameter, string language)
        {
            return System.Convert.ChangeType(value, targetType);
        }
    }
}
